<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <form>
        <input type="text" required="required" autofocus="autofocus" /><br />
        <input type="submit" value="提交" id="btn" />
    </form>

    <script src="../../js/jquery-3.2.1.js"></script>

    <script>
        $("#btn").click(function () {
            var message = $("input[type='text']").val();
            window.parent.frames[1].postMessage(message, '*');
        });
    </script>
</body>

</html>